package com.ynny;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope
@RestController
public class ProviderController {
    @Value("${server.port}")
    private String serverPort;
    @GetMapping("/provider/hello")
    public String hello(){
        try{
            Thread.sleep(5000); //线程等待时间
        }catch(InterruptedException e ){
            e.printStackTrace();
        }
        return "hello world from serverPort:"+serverPort;
    }
}
